import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-05-24
 * Time: 17:17
 */
public class Test3 {
    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str;
        str = sc.next();
        int i=0, j=0;
        if(str.length() != 0)
            System.out.print("d["+i+","+j+"] = ");
        for(int k=0; k<str.length(); k++) {
            if(str.charAt(k) == ',') {
                ++j;
                System.out.print(" d["+i+","+j+"] = ");
            }
            else if (str.charAt(k) == ';') {
                ++i;
                j = 0;
                System.out.print("\nd["+i+","+j+"] = ");
            }
            else {
                System.out.print(str.charAt(k));
            }
        }
        sc.close();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int i = 0;
        int j = 0;
        if(str.length() != 0) {
            System.out.print("d[" + i + "," + j++ + "] = ");
        }
        int n = 0;
        for (int k = 0; k < str.length(); k++) {
            char c = str.charAt(k);
            if(c == ',') {
                System.out.print(" d[" + i + "," + ++j + "] = ");
                n = 0;
            } else if (c == ';') {
                j = 0;
                System.out.print("\nd[" + ++i + "," + j + "] = ");
            } else {
                n = n * 10 + c - '0';

            }
        }
    }
}
